package com.bootdo.finance.controller;


import com.bootdo.common.utils.PageUtils;
import com.bootdo.common.utils.Query;
import com.bootdo.sell.domain.ClearingformDO;
import com.bootdo.sell.service.ClearingformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/fin/table")
public class DemoController {

    @Autowired
    private ClearingformService clearingformService;

   /* @ResponseBody
    @GetMapping("/list")
    public PageUtils list(@RequestParam Map<String, Object> params){
        //查询列表数据
        Query query = new Query(params);
        List<GoodsDO> goodsList = goodsService.list(query);
        int total = goodsService.count(query);
        PageUtils pageUtils = new PageUtils(goodsList, total);
        return pageUtils;
    }*/


   //账户
   @ResponseBody
   @GetMapping("/list")
   public PageUtils list(@RequestParam Map<String, Object> params){
       Query query = new Query(params);
       List<ClearingformDO> goodsList = clearingformService.list(query);
       int total = clearingformService.count(query);
       PageUtils pageUtils = new PageUtils(goodsList, total);
       return pageUtils;
   }

    @GetMapping("/table")
    public String table(){return "finance/transferaccounts/gettypetable";}



    @ResponseBody
    @GetMapping("/list1")
    public List<ClearingformDO> list1(@RequestParam Map<String, Object> params){
        Map<String, Object> map = new HashMap<String, Object>();
        List<ClearingformDO> goodsList = clearingformService.list(map);
        return goodsList;
    }

    @ResponseBody
    @GetMapping("/list2")
    public List<ClearingformDO> list2(@RequestParam Map<String, Object> params){
        Map<String, Object> map = new HashMap<String, Object>();
        List<ClearingformDO> goodsList = clearingformService.list(map);
        return goodsList;
    }
}


